//
//  main.cpp
//  Practice12
//
//  Created by 赵世杰 on 2020/8/2.
//  Copyright © 2020 zhaoshijie. All rights reserved.
//

#include <iostream>
#include "CowClass.hpp"
#include "String2Class.hpp"
#include "stock20.hpp"


using namespace std;


const int STKS = 4;


int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    
    
    
    /*
    
    //  1、
    
    Cow cow1 ;

    cow1.ShowCow();
    
    Cow cow2("zhaoshijie","basketball",60);
    cow2.ShowCow();
    
    Cow cow3 ;
    cow3 = cow2;
    cow3.ShowCow();
    
    
    */
    
    
    /*
    
    //  2、
    
    String2 s1("and I am a C++ student.");
    String2 s2 = "Please enter your name:";
    String2 s3 ;
    cout << s2;
    cin >> s3;
    s2 = "My name is " + s3;
    cout << s2 << ".\n";
    s2 = s2+s1;
    s2.Stringbig();
    cout << "The string\n" << s2 << "\ncontains " << s2.StringInCharCount('A') << " 'A' characters in it. \n";
    s1 = "red";
    String2 rgb[3] = {String2(s1) , String2("green") , String2("blue")};
    cout << "Enter the name of a primary color for mixing light: ";
    String2 ans;
    bool success  = false;
    while (cin >> ans)
    {
        ans.Stringlow();
        
        for(int i=0 ; i<3 ; i++)
        {
            
            if(ans == rgb[i])
            {
                cout << "That's right!\n";
                success = true;
                break;
            }
            
        }
        
        if(success)
            break;
        else
            cout << "Try agin!\n";
        
    }
    
    cout << "Bye\n";
    
    
    */
    
    /*
    
    //  3、
    
    Stock stock[STKS] = {
        Stock("NanoSmart",12,20),
        Stock("Boffo Objects",200,2.0),
        Stock("Monolithic Obelisks",130,3.25),
        Stock("Fleep Enterprice",60,6.5),
        
    };
    
    cout << "Stock holdings:\n";
    
    int st;
    
    for(st = 0 ; st < STKS ; st++)
    {
        stock[st].show();
        
    }
    
    const Stock *top = &stock[0];
    
    for(st = 1 ; st < STKS ; st ++)
    {
        top = &top->topval(stock[st]);
    }
    
    cout << "\nMost Valuable holding: \n";
    
    top -> show();
    
    */
    
    
    
    
    return 0;
}
